#ifndef NEWCOLLECTCHANNELDIALOG_H
#define NEWCOLLECTCHANNELDIALOG_H

#include <QDialog>
#include <QMap>
#include "./Model/ProjectModel.h"
#include "ProtocolDialog.h"
namespace Ui {
class NewCollectChannelDialog;
}

class NewCollectChannelDialog : public QDialog
{
    Q_OBJECT

public:
    explicit NewCollectChannelDialog(QWidget *parent = nullptr);
    ~NewCollectChannelDialog();

    void SetInitChannelName(QString name);
    stCollectChannel getChannel();

private slots:
    void on_comboBox_currentTextChanged(const QString &arg1);

    void on_proto_Button_clicked();


    void on_pushButton_clicked();

    void on_pushButton_2_clicked();

private:
    void InitWidget();

private:
    Ui::NewCollectChannelDialog *ui;
    QWidget * m_widgetTcpClient;
    QWidget * m_widgetSerialport;
    QWidget * m_widgetTcpServer;
    QWidget * m_widgetReserve; //备用
    QMap<QString,QWidget*> m_mapChilds;

    stCollectChannel m_channel;
};

#endif // NEWCOLLECTCHANNELDIALOG_H
